#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint camera_product_plugin.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
  s.name             = 'camera_product_plugin'
  s.version          = '0.0.1'
  s.summary          = 'A new Flutter plugin project.'
  s.description      = <<-DESC
A new Flutter plugin project.
                       DESC
  s.homepage         = 'http://example.com'
  s.license          = { :file => '../LICENSE' }
  s.author           = { 'Your Company' => 'email@example.com' }
  s.source           = { :path => '.' }
  # s.source_files = 'Classes/**/*'
  s.public_header_files = 'Classes/**/*.h'
  s.dependency 'Flutter'
  s.platform = :ios, '12.0'

  # Flutter.framework does not contain a i386 slice.
  # s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }

  # If your plugin requires a privacy manifest, for example if it uses any
  # required reason APIs, update the PrivacyInfo.xcprivacy file to describe your
  # plugin's privacy impact, and then uncomment this line. For more information,
  # see https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
  # s.resource_bundles = {'camera_product_plugin_privacy' => ['Resources/PrivacyInfo.xcprivacy']}

  # Objective-C 源文件
  s.source_files = 'Classes/**/*.{h,m}'
  
  # 添加三个第三方框架
  s.vendored_frameworks = [
    'Frameworks/BaseCamera.framework',
    'Frameworks/BKCamera.framework',
    'Frameworks/WDLogger.framework',
    'Frameworks/BluetoothConfiger.framework'
  ]
  
  # 系统框架依赖（根据你的第三方库需求调整）
  s.frameworks = [
    'UIKit', 
    'Foundation', 
    'CoreLocation', 
    'SystemConfiguration',
    'AVFoundation',
    'CoreGraphics'
  ]
  
  s.libraries = ['z', 'sqlite3', 'c++']
  
  # 编译配置
  s.pod_target_xcconfig = {
    'DEFINES_MODULE' => 'YES',
    'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386',
    
    # 头文件搜索路径
    'HEADER_SEARCH_PATHS' => [
      '"${PODS_ROOT}/../Frameworks/BaseCamera.framework/Headers"',
      '"${PODS_ROOT}/../Frameworks/BKCamera.framework/Headers"',
      '"${PODS_ROOT}/../Frameworks/WDLogger.framework/Headers"',
      '"${PODS_ROOT}/../Frameworks/BluetoothConfiger.framework/Headers"'
    ].join(' '),
    
    # 框架搜索路径
    'FRAMEWORK_SEARCH_PATHS' => '"${PODS_ROOT}/../Frameworks"',
    
    # 链接器标志
    'OTHER_LDFLAGS' => '-framework BaseCamera -framework BKCamera -framework WDLogger -framework BluetoothConfiger -ObjC',
    
    # Objective-C 配置
    'GCC_ENABLE_OBJC_EXCEPTIONS' => 'YES',
    'CLANG_ENABLE_OBJC_WEAK' => 'YES',
    'CLANG_ENABLE_MODULES' => 'YES'
  }

end
